﻿@{
    Layout = null;
}
@*@model List<BNS_Education.Model.KJKHKH>*@
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <link href="~/H-ui/static/h-ui/css/H-ui.min.css" rel="stylesheet" />
    <link href="~/H-ui/static/h-ui.admin/css/H-ui.admin.css" rel="stylesheet" />
    <link href="~/H-ui/lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" />
    <link href="~/H-ui/static/h-ui.admin/skin/default/skin.css" rel="stylesheet" />
    <link href="~/H-ui/static/h-ui.admin/css/style.css" rel="stylesheet" />
    <script src="~/H-ui/lib/jquery/1.9.1/jquery.min.js"></script>
    <script src="~/H-ui/lib/layer/2.4/layer.js"></script>
    <script src="~/H-ui/static/h-ui/js/H-ui.min.js"></script>
    <script src="~/H-ui/static/h-ui.admin/js/H-ui.admin.js"></script>
    <script src="~/H-ui/lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
    <script src="~/Scripts/jquery-1.10.2.js"></script>
    <style>
        #modal-overlay {
            visibility: hidden;
            position: absolute; /* 使用绝对定位或固定定位  */
            left: 0px;
            top: 0px;
            width: 100%;
            height: 100%;
            text-align: center;
            z-index: 1000;
            background-color: #333;
            opacity: 0.9; /* 背景半透明 */
        }
        /* 模态框样式 */
        .modal-data {
            width: 400px;
            margin: 100px auto;
            background-color: #fff;
            border: 1px solid #000;
            padding: 15px;
            text-align: center;
        }

        table tr #nav {
            background: aqua;
            width: 137px;
            height: 44px;
            font-size: large;
        }

        table tr #show {
            width: 130px;
            height: 44px;
        }
    </style>

</head>
<body>
    <!--图片-->
    <div>
        <img src="~/K_image/nav123.png" style="width:100%;" />
    </div>
    <!--主体-->
    <div style="width:1100px; height:535px;margin:0 auto;">
        <!--间隔-->
        <div style="margin-top:25px;">
            <!--试卷Login-->
            <div style="width:1100px;height:40px; ">
                <span style="font-weight:300;font-size:larger;margin-top:20px;"><i class="Hui-iconfont">&#xe67e;我的试卷</i></span>
            </div>
            <hr />
            <br />
            <!--显示主体-->
            <div style="height:480px;">
                <!--查询与新建-->
                <div style="height:50px;">
                    <!--查询-->
                    <form action="/Paper/Index" method="get">
                        <div style="width:770px;float:left;">
                            <input type="text" placeholder="试卷名称关键字" name="shijuan" class="input-text ac-input size-S" style="width:150px;margin-top:10px;margin-left:20px;" /><button style="margin-top:10px;" class="btn btn-success radius size-S" type="submit"><i class="Hui-iconfont">&#xe665;</i></button>
                        </div>
                    </form>
                  
                    <!--示例-->
                    <div style="margin-top:10px; width:150px;float:left;">
                        <span style="margin-left:10px;font-size:larger;color:aqua;">示例&nbsp;<button class="btn btn-default" title="展开所有子卷"><i class="Hui-iconfont">&#xe61f;</i></button>&nbsp;<button class="btn btn-default" title="收起所有子卷"><i class="Hui-iconfont">&#xe610;</i></button></span>
                    </div>
                    <!--新建-->
                    <div style="width:130px;float:right;">
                        <button class="btn btn-warning" style="margin-top:10px;width:130px;"  onclick="overlay()"><i class="Hui-iconfont">&#xe600;</i >新建试卷</button>
                    </div>
                </div>
                <!--试卷信息栏-->
                <div>
                    <table>
                        <tr>
                            <th id="nav">试卷名称</th>
                            <th id="nav">子卷数</th>
                            <th id="nav">总题数</th>
                            <th id="nav">总分值</th>
                            <th id="nav">总时长</th>
                            <th id="nav">试卷状态</th>
                            <th id="nav">操作</th>
                            <th id="nav">&nbsp;</th>
                        </tr>
                    </table>
                </div>
                <!--试卷信息展示-->
                <ul id="Huifold1" class="Huifold">
                    @foreach (var item in ViewBag.aaa)
                    {
                        <li class="item">
                            <h4>
                                <table>
                                    <tr>
                                        <td id="show">@item.testpaperName</td>
                                        <td id="show">2</td>
                                        <td id="show">7</td>
                                        <td id="show">4</td>
                                        <td id="show">5</td>
                                        <td id="show">未锁定</td>
                                        <td id="show">
                                            <table>
                                                <tr>
                                                    <td><a href="#" style="text-decoration:none;">编辑</a></td>
                                                    <td><a href="/Paper/Delete/+@item.testpaperId" style="text-decoration:none;">删除</a></td>
                                                    <td></td>
                                                </tr>
                                                <tr>
                                                    <td><button class="btn btn-primary" onclick="Addzijuan()">添加子卷</button></td>
                                                    <td><button class="btn btn-secondary-outline" onclick="yulanshijuan()">预览试卷</button></td>
                                                    <td></td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                                <b>+</b>
                            </h4>
                            <div class="info" style="margin:0 auto;width:979px;height:44px;">
                                <table>
                                    <tr>
                                        <td width="62">No.</td>
                                        <td width="190">子卷名称</td>
                                        <td width="55">题数</td>
                                        <td width="80">分值</td>
                                        <td width="70">时长</td>
                                        <td width="70">试题乱序</td>
                                        <td width="70">选项乱序</td>
                                        <td width="100">提交后修改</td>
                                        <td>操作</td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td>@item.SubvolumesName</td>
                                        <td></td>
                                        <td></td>
                                        <td>@item.SubvolumesShiJian</td>
                                        <td>@item.Subvolumesshitiluanxu</td>
                                        <td>@item.Subvolumesxuanxiangluanxu</td>
                                        <td></td>
                                        <td></td>
                                        <td>
                                            <table>
                                                <tr>
                                                    <td><button onclick="Udate(@item.SubvolumesId)">编辑</button></td>
                                                    <td><a href="/Paper/shanchu/"@item.SubvolumesId>删除</a></td>
                                                </tr>
                                                <tr>
                                                    <td><button onclick="Addshiti()">添加试题</button></td>
                                                    <td><button onclick="guanlishiti()">管理试题</button></td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>

                                </table>
                            </div>
                        </li>
                    }
                </ul>
            </div>
        </div>
    </div>
    <!--模态窗-->
    <div id="modal-overlay">
        <div class="modal-data">
            <p>试卷名称<input type="text" id="shijuan" placeholder="例如，“软件开发类（Java）试卷”，必填项" class="input-text ac-input" style="width:300px;" /> </p>
            <p>试卷备注<input type="text" id="beizhu" placeholder="例如：华北区使用，可不填" class="input-text ac-input" style="width:200px;width:300px" /> </p>
            <p><button onclick="overlay()" id="sumbtn" style="width:200px;color:#000">提交</button></p>
        </div>
    </div>
</body>
</html>
<script>
    $.ajax({
        url: "/Paper/xiugaishijuanName",
        type: "post",
        data:{},
        success:function(data)
        {

        }
    })
    function Udate()
    {

    }
    
    $(function () {
        $.Huifold("#Huifold1 .item h4", "#Huifold1 .item .info", "fast", 3, "click"); /*5个参数顺序不可打乱，分别是：相应区,隐藏显示的内容,速度,类型,事件*/
    });
    jQuery.Huifold = function (obj, obj_c, speed, obj_type, Event) {
        if (obj_type == 2) {
            $(obj + ":first").find("b").html("-");
            $(obj_c + ":first").show()
        }
        $(obj).bind(Event, function () {
            if ($(this).next().is(":visible")) {
                if (obj_type == 2) {
                    return false
                }
                else {
                    $(this).next().slideUp(speed).end().removeClass("selected");
                    $(this).find("b").html("+")
                }
            }
            else {
                if (obj_type == 3) {
                    $(this).next().slideDown(speed).end().addClass("selected");
                    $(this).find("b").html("-")
                } else {
                    $(obj_c).slideUp(speed);
                    $(obj).removeClass("selected");
                    $(obj).find("b").html("+");
                    $(this).next().slideDown(speed).end().addClass("selected");
                    $(this).find("b").html("-")
                }
            }
        })
    }
    function overlay() {
        var e1 = document.getElementById('modal-overlay');
        e1.style.visibility = (e1.style.visibility == "visible") ? "hidden" : "visible";
    }
    $("#sumbtn").click(function () {
        $.ajax({
            url: "/Paper/shijuan",
            type: "POST",
            data: { shijuan: $("#shijuan").val(), beizhu: $("#beizhu").val() },
            success: function (data) {
                if (data > 0) {
                    $("#overlay").hide();
                    alert("保存成功");
                }
                else if (data == 1) {
                    alert("信息填写不完整");
                }
                else {
                    alert("保存失败")
                }
            }
        })
    })
</script>
